from apps.common.base.views import *
from apps.merchant.item.serializers import *
from apps.merchant.item.dao import ItemDao
from apps.merchant.item.filters import ItemFilter

def getItemAll(self):
    _list = ItemDao().findAll().select_related('lessee', 'cate', 'activity').prefetch_related('item_sku')
    return _list

class BaseItemViewSet(BaseViewSet):
    serializer_class = ItemModelSerializer
    filter_class = ItemFilter
    DAO_CLASS = ItemDao
